import { ReturnType, customError, post } from '..'
import { Reword } from '../interface'
import { URL_GET_REWARD, URL_REWARD_INFO } from '../base/url'

export const inviteReward = async (): Promise<ReturnType<Reword | undefined>> => {
    try {
        const result = await post<Reword>(URL_REWARD_INFO)
        return result
    } catch (error: any) {
        return customError(error)
    }
}

export const reward = async (params: { type: string }): Promise<ReturnType<undefined>> => {
    try {
        const result = await post(URL_GET_REWARD, params)
        return result
    } catch (error: any) {
        return customError(error)
    }
}
